Repository navigation
Conversation
Resolve relative readlink targets from the original link parent in both copytree and dependency copying, rather than the current directory. Assisted-by: Codex/GPT-6
There was a problem hiding this comment.
✅ Lambda Tooling PR Reviewer: No high-confidence issues found.
1 lower-confidence observation: these passed verification at a lower score, so check before acting
1. [BUG] aws_lambda_builders/utils.py:108: Joined relative target may resolve to the wrong path on Windows when the link's parent is a directory symlink
The new code joins the raw os.readlink() target onto the unresolved parent, which gives a path like root\alias\..\target. create_symlink_or_copy passes that path through Path.absolute(), which does not normalize it. Win32 path handling removes .. as text before it follows the alias reparse point, so the new link (or the copy fallback) would point at root\target instead of root\real\target. The same line appears at aws_lambda_builders/actions.py:239. To check, run the new source_alias=True test cases on native Windows CI. If they read "wrong target", resolving the parent first with os.path.join(os.path.realpath(os.path.dirname(new_source)), os.readlink(new_source)) should fix both call sites.
Assisted-by: Codex/GPT-6
Expand source-parent directory symlinks crossed by relative parent components while retaining junction context and final target links. Reject invalid targets that escape their volume root. Assisted-by: Codex/GPT-6
Issue #, if available: N/A
Description of changes
With
maintain_symlinks=True,copytreeandCopyDependenciesActioninterpreted relativereadlink()targets against the working directory, which could select a different file or directory.Use a shared internal helper to anchor targets to the source link. On Windows, expand directory symlinks crossed by leading parent components while retaining junction context and final target links. Reject targets that escape the volume root instead of selecting a valid file after normalization. Existing absolute targets, default copying and copy fallback are preserved.
Description of how you validated changes
env -u RUST_LOG make prpassed 1,213 tests and 64 subtests, with 9 Windows-only skips and 94.94% coverage; Ruff and Black passed. The inherited Rust logging override also fails its logger test on the base.make pron Python 3.10 and 3.14. All 25 new regressions and 17 additional source-target cases passed on both versions. These fork diagnostics are separate from upstream approval gates.AI-assisted implementation and CI fixes with Codex/GPT-6.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.